home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / linux / tools / amiga / gzip-1.1.2.lha / gzip-1.1.2 / gzip.doc < prev    next >
Encoding:
Text File  |  1993-06-04  |  10.9 KB  |  268 lines

  1.  
  2. GZIP(1)                  USER COMMANDS                    GZIP(1)
  3.  
  4. NAME
  5.      gzip, gunzip, zcat - compress or expand files
  6.  
  7. SYNOPSIS
  8.      gzip [ -acdfhLrtvV19 ] [-S suffix] [ name ... ]
  9.      gunzip [ -acfhLrtvV ] [-S suffix] [ name ... ]
  10.      zcat [ -hLV ] [ name ... ]
  11.  
  12. DESCRIPTION
  13.      Gzip reduces the size of the named  files  using  Lempel-Ziv
  14.      coding  (LZ77).  Whenever possible, each file is replaced by
  15.      one with the extension .gz, while keeping the same ownership
  16.      modes,  access  and modification times.  (The default exten-
  17.      sion is -gz for VMS, z for MSDOS, OS/2 FAT and Atari.) If no
  18.      files are specified, the standard input is compressed to the
  19.      standard output. If the new file  name  is  too  long,  gzip
  20.      truncates  it  and  keeps  the  original  file  name  in the
  21.      compressed file.  Gzip will only attempt to compress regular
  22.      files.  In particular, it will ignore symbolic links.
  23.  
  24.      Compressed files can be  restored  to  their  original  form
  25.      using gzip -d or gunzip or zcat.
  26.  
  27.      gunzip takes a  list  of  files  on  its  command  line  and
  28.      replaces each file whose name ends with .gz, -gz, .z, -z, _z
  29.      or .Z and which begins with the correct magic number with an
  30.      uncompressed  file  without  the original extension.  gunzip
  31.      also recognizes the special  extensions  .tgz  and  .taz  as
  32.      shorthands for .tar.gz and .tar.Z respectively.
  33.  
  34.      gunzip can currently decompress files created by gzip,  zip,
  35.      compress  or  pack.  The  detection  of  the input format is
  36.      automatic.  When using the first two formats, gunzip  checks
  37.      a  32  bit  CRC.  For  pack,  gunzip checks the uncompressed
  38.      length. The compress format was not designed to  allow  con-
  39.      sistency  checks. However gunzip is sometimes able to detect
  40.      a bad .Z file. If you get an error when uncompressing  a  .Z
  41.      file,  do  not  assume  that  the  .Z file is correct simply
  42.      because the standard uncompress does not complain. This gen-
  43.      erally means that the standard uncompress does not check its
  44.      input, and happily generates garbage output.
  45.  
  46.      Files created by zip can be uncompressed  by  gzip  only  if
  47.      they  have  a  single member compressed with the 'deflation'
  48.      method. This feature is only intended to help conversion  of
  49.      tar.zip  files  to  the  tar.gz format. To extract zip files
  50.      with several members, use unzip instead of gunzip.
  51.  
  52.      zcat is identical to gunzip -c. (On some systems,  zcat  may
  53.      be  installed  as  gzcat  to  preserve  the original link to
  54.      compress.) zcat uncompresses either a list of files  on  the
  55.      command   line   or   its  standard  input  and  writes  the
  56.  
  57. Sun Release 4.1        Last change: local                       1
  58.  
  59. GZIP(1)                  USER COMMANDS                    GZIP(1)
  60.  
  61.      uncompressed data on standard output.  zcat will  uncompress
  62.      files that have the correct magic number whether they have a
  63.      .gz suffix or not.
  64.  
  65.      Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
  66.      The  amount  of  compression obtained depends on the size of
  67.      the input and the distribution of common substrings.   Typi-
  68.      cally,  text  such  as  source code or English is reduced by
  69.      60-70%.  Compression is  generally  much  better  than  that
  70.      achieved  by  LZW  (as used in compress), Huffman coding (as
  71.      used in pack), or adaptive Huffman coding (compact).
  72.  
  73.      Compression is always performed, even if the compressed file
  74.      is  slightly larger than the original. The worst case expan-
  75.      sion is a few bytes for the gzip file header, plus  5  bytes
  76.      every  32K  block, or an expansion ratio of 0.015% for large
  77.      files. Note that the  actual  number  of  used  disk  blocks
  78.      almost  never increases.  gzip preserves the mode, ownership
  79.      and timestamps of files when compressing or decompressing.
  80.  
  81. OPTIONS
  82.      -a --ascii
  83.           Ascii text mode: convert end-of-lines using local  con-
  84.           ventions.  This  option  is supported only on some non-
  85.           Unix systems. For MSDOS, CR LF is converted to LF  when
  86.           compressing,   and  LF  is  converted  to  CR  LF  when
  87.           decompressing.
  88.  
  89.      -c --stdout
  90.           Write output on standard output;  keep  original  files
  91.           unchanged.   If there are several input files, the out-
  92.           put consists of a sequence of independently  compressed
  93.           members.  To obtain better compression, concatenate all
  94.           input files before compressing them.
  95.  
  96.      -d --decompress --uncompress
  97.           Decompress.
  98.  
  99.      -f --force
  100.           Force compression or decompression even if the file has
  101.           multiple   links  or  the  corresponding  file  already
  102.           exists, or if the compressed data is read from or writ-
  103.           ten  to  a  terminal.  If -f is not given, and when not
  104.           running in  the  background,  gzip  prompts  to  verify
  105.           whether an existing file should be overwritten.
  106.  
  107.      -h --help
  108.           Display a help screen and quit.
  109.  
  110.      -L --license
  111.           Display the gzip license.
  112.  
  113. Sun Release 4.1        Last change: local                       2
  114.  
  115. GZIP(1)                  USER COMMANDS                    GZIP(1)
  116.  
  117.      -q --quiet
  118.           Suppress all warnings.
  119.  
  120.      -r --recurse
  121.           Travel the directory structure recursively. If  any  of
  122.           the file names specified on the command line are direc-
  123.           tories,  gzip  will  descend  into  the  directory  and
  124.           compress  all  the  files it finds there (or decompress
  125.           them in the case of gunzip ).
  126.  
  127.      -S .suf --suffix .suf
  128.           Use suffix .suf instead  of  .gz.  Any  suffix  can  be
  129.           given,  but  suffixes  other  than .z and .gz should be
  130.           avoided to avoid confusion when files  are  transferred
  131.           to  other  systems.  Previous versions of gzip used the
  132.           .z suffix. This was changed to avoid  a  conflict  with
  133.           pack(1).
  134.  
  135.      -t --test
  136.           Test. Check the compressed file integrity.
  137.  
  138.      -v --verbose
  139.           Verbose. Display the name and percentage reduction  for
  140.           each file compressed or decompressed.
  141.  
  142.      -V --version
  143.           Version. Display the  version  number  and  compilation
  144.           options then quit.
  145.  
  146.      -# --fast --best
  147.           Regulate the speed of compression using  the  specified
  148.           digit  #,  where  -1  or  --fast  indicates the fastest
  149.           compression method (less compression) and -9 or  --best
  150.           indicates   the  slowest  compression  method  (optimal
  151.           compression).  The default compression level is -5.
  152.  
  153. ADVANCED USAGE
  154.      Multiple compressed files can be concatenated. In this case,
  155.      gunzip will extract all members at once. For example:
  156.  
  157.            gzip -c file1  > foo.gz
  158.            gzip -c file2 >> foo.gz
  159.  
  160.      Then
  161.            gunzip -c foo
  162.  
  163.      is equivalent to
  164.  
  165.            cat file1 file2
  166.  
  167.      In case of damage to one member of a .gz file, other members
  168.      can  still  be recovered (if the damaged member is removed).
  169.  
  170. Sun Release 4.1        Last change: local                       3
  171.  
  172. GZIP(1)                  USER COMMANDS                    GZIP(1)
  173.  
  174.      However, you can get better compression by  compressing  all
  175.      members at once:
  176.  
  177.            cat file1 file2 | gzip > foo.gz
  178.  
  179.      compresses better than
  180.  
  181.            gzip -c file1 file2 > foo.gz
  182.  
  183.      If you want to recompress concatenated files to  get  better
  184.      compression, do:
  185.  
  186.            zcat old.gz | gzip > new.gz
  187.  
  188. ENVIRONMENT
  189.      The environment variable GZIP can  hold  a  set  of  default
  190.      options  for  gzip.  These options are interpreted first and
  191.      can be overwritten by explicit command line parameters.  For
  192.      example:
  193.            for sh:    GZIP="-8 -v"; export GZIP
  194.            for csh:   setenv GZIP "-8 -v"
  195.            for MSDOS: set GZIP=-8 -v
  196.  
  197.      On  Vax/VMS,  the  name  of  the  environment  variable   is
  198.      GZIP_OPT,  to avoid a conflict with the symbol set for invo-
  199.      cation of the program.
  200.  
  201. SEE ALSO
  202.      znew(1), zcmp(1),  zmore(1),  zforce(1),  gzexe(1),  zip(1),
  203.      unzip(1), compress(1), pack(1), compact(1)
  204.  
  205. DIAGNOSTICS
  206.      Exit status is normally 0; if an error occurs,  exit  status
  207.      is 1. If a warning occurs, exit status is 2.
  208.  
  209.      Usage: gzip [-cdfhLrtvV19] [-S suffix] [file ...]
  210.              Invalid options were specified on the command line.
  211.      file: not in gzip format
  212.              The  file  specified  to   gunzip   has   not   been
  213.              compressed.
  214.      file: Corrupt input. Use zcat to recover some data.
  215.              The compressed file has been damaged. The data up to
  216.              the point of failure can be recovered using
  217.                      zcat file > recover
  218.      file: compressed with xx bits, can only handle yy bits
  219.              File was compressed (using LZW) by  a  program  that
  220.              could  deal  with more bits than the decompress code
  221.              on this machine.  Recompress  the  file  with  gzip,
  222.              which compresses better and uses less memory.
  223.      file: already has .gz suffix -- no change
  224.              The  file  is  assumed  to  be  already  compressed.
  225.              Rename the file and try again.
  226.  
  227. Sun Release 4.1        Last change: local                       4
  228.  
  229. GZIP(1)                  USER COMMANDS                    GZIP(1)
  230.  
  231.      file already exists; do you wish to overwrite (y or n)?
  232.              Respond "y" if  you  want  the  output  file  to  be
  233.              replaced; "n" if not.
  234.      gunzip: corrupt input
  235.              A SIGSEGV violation was detected which usually means
  236.              that the input file has been corrupted.
  237.      xx.x%
  238.              Percentage  of  the  input  saved  by   compression.
  239.              (Relevant only for -v.)
  240.      -- not a regular file or directory: ignored
  241.              When the input file is not a regular file or  direc-
  242.              tory,  (e.g.  a  symbolic link, socket, FIFO, device
  243.              file), it is left unaltered.
  244.      -- has xx other links: unchanged
  245.              The input file has links; it is left unchanged.  See
  246.              ln(1) for more information. Use the -f flag to force
  247.              compression of multiply-linked files.
  248.  
  249. CAVEATS
  250.      When writing compressed data to  a  tape,  it  is  generally
  251.      necessary  to pad the output with zeroes up to a block boun-
  252.      dary. When the data is read and the whole block is passed to
  253.      gunzip for decompression, gunzip detects that there is extra
  254.      trailing garbage after the compressed data and emits a warn-
  255.      ing  by  default.  You  have  to  use  the --quiet option to
  256.      suppress the warning. This option can be  set  in  the  GZIP
  257.      environment variable as in:
  258.          for sh:    GZIP="-q"  tar xfz /dev/rmt/datn
  259.          for csh:   (setenv GZIP "-q"; tar xfz /dev/rmt/datn)
  260.  
  261.      In the above example, gzip is invoked implicitly by  the  -z
  262.      option  of  GNU  tar. Make sure that the same block size (-b
  263.      option of tar) is used for reading  and  writing  compressed
  264.      data on tapes.
  265.  
  266. Sun Release 4.1        Last change: local                       5
  267.  
  268.